//int handlers
//wssccc ROBOT SDK 1.1

//2010-4-15

/*
 __  __  __    ____    ____    ___    ___    ___   
/\ \/\ \/\ \  /',__\  /',__\  /'___\ /'___\ /'___\ 
\ \ \_/ \_/ \/\__, `\/\__, `\/\ \__//\ \__//\ \__/ 
 \ \___x___/'\/\____/\/\____/\ \____\ \____\ \____\
  \/__//__/   \/___/  \/___/  \/____/\/____/\/____/
  
MAIL : wssccc@gmail.com                                                    
  */
  
#define MAX_COUNTER 1000
//global var
int g_leftCounter;
int g_rightCounter;


#pragma interrupt_handler int0_isr:2
void int0_isr(void)
{
 //external interupt on INT0
 g_leftCounter=(g_leftCounter+1) % MAX_COUNTER;
 
}

#pragma interrupt_handler int1_isr:3
void int1_isr(void)
{
 //external interupt on INT1
 g_rightCounter=(g_rightCounter+1) % MAX_COUNTER;
 
}

int stopTest(){
	g_leftCounter=0;
	g_rightCounter=0;
	forward(5,LOW_SPEED);
	if((!g_leftCounter)||(!g_rightCounter)){
			return 1;
	}else{
		    return 0;
	}
}
